const koa = require('koa')
const mongoose = require('mongoose')
const app = new koa()
const views = require('koa-views')
const {resolve} = require('path')
const {connect,initSchemas} = require('./database/init')

;(async ()=>{
    await connect()

    initSchemas()

    // require('./tasks/movie')
    require('./tasks/api')
})()

app.use(views(resolve(__dirname,'./views'),{
    extension:'pug'
}))

app.use(async ctx =>{
await ctx.render('index',{
    you:'like',
    me:'me'
})
})

app.listen(2333)